﻿// 1.1.6.09. Write a program that for a given N calculates the expression: S = 1!/x + 2!/x*x + 3!/x*x*x + ... + n!/math.pow(x, n).

using System;

class MathSequence
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        double result = 1;
        int x = 1;
        for (int n = 1; n <= N; n++)
        {
            for (int dividendFactorialCounter = n - 1, dividendCalculations = n; dividendFactorialCounter > 1; dividendFactorialCounter--)
            {
                dividendCalculations *= dividendFactorialCounter;
                if (dividendFactorialCounter == 2)
                {
                    N = dividendCalculations;   // using N for saving memory ;P
                }
            }
            result += N / Math.Pow(x, n);
        }
        
        Console.WriteLine(result);
    }
}
